home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 8_6.lha / 8_6 / 8_6_init.c < prev    next >
Text File  |  1993-08-08  |  992b  |  36 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / declare a suitable amount of buffer space for cout
  6. tatic char cout_buf[BUFSIZ];
  7.  
  8. / Make a filebuf to manage that space.
  9. / Bind it to the UNIX FILE pointer stdout
  10. tatic filebuf cout_file
  11.    (stdout, cout_buf, sizeof(cout_buf));
  12.  
  13. / make the ostream providing the user interface
  14. stream cout(&cout_file);
  15.  
  16. / declare a suitable amount of buffer space for cerr
  17. tatic char cerr_buf[1];
  18.  
  19. / Make a filebuf to manage that space.
  20. / Bind it to the UNIX FILE pointer stderr
  21. tatic filebuf cerr_file
  22.    (stderr, cerr_buf, sizeof(cerr_buf));
  23.  
  24. stream cerr(&cerr_file);
  25.  
  26. / declare a suitable amount of buffer space for cin
  27. tatic char cin_buf[BUFSIZ];
  28.  
  29. / Make a filebuf to manage that space.
  30. / Bind it to the UNIX FILE pointer stdin
  31. tatic filebuf cin_file
  32.    (stdin, cin_buf, sizeof(cin_buf));
  33.  
  34. / make the istream providing the user interface
  35. stream cin(&cin_file);
  36.